home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / ModObjectsMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  16.8 KB  |  531 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  13 April 1997
  22. //
  23. //  Procedure Name:
  24. //      ModObjectsMenu
  25. //
  26. //  Description:
  27. //        Create the MODELLING->Objects menu
  28. //
  29. //  Input Arguments:
  30. //      parent to parent the menu to.
  31. //
  32. //  Return Value:
  33. //      None.
  34. //
  35.  
  36. global proc updateModObjectsMenu ( string $parent )
  37. {
  38.     setParent -m $parent;
  39.  
  40.     string $lsObjs[] = `ls -geometry`;
  41.     string $lslive[] = `ls -live`;
  42.     
  43.     if (size($lsObjs) == 0 || size($lslive) == 0) {
  44.         menuItem -edit -l "Make Live"
  45.             -annotation "Make Live: Select a surface" liveItem;
  46.     } else {
  47.           string $lsSel[] = `ls -sl`; 
  48.         if (size($lsSel) == 0) {
  49.             menuItem -edit -l "Make Not Live" 
  50.             -annotation "Make Not Live: Revert live surface" liveItem;
  51.         } else {
  52.             menuItem -edit -l "Make Live" 
  53.                 -annotation "Make Live: Select a surface" liveItem;
  54.         }
  55.     }
  56. }
  57.  
  58. global proc ModObjectsMenu( string $parent )
  59. {
  60.     int $dimWhenNoSelect = 0;
  61.     setParent -m $parent;
  62.  
  63.     if( `menu -q -ni $parent` != 0 ) {
  64.         //
  65.         //    Menu is built already
  66.         //
  67.           updateModObjectsMenu ($parent);
  68.         return;
  69.     }
  70.  
  71.     //    Transforms
  72.     //
  73.     menuItem -l "Transformation Tools" -sm true -to true -aob true transHierItem;
  74.         menuItem 
  75.             -label "Move Tool" 
  76.             -annotation (getRunTimeCommandAnnotation("MoveTool"))
  77.             -image "move_M.xpm"
  78.             -command "MoveTool"
  79.             -dragDoubleClickCommand "MoveToolOptions"
  80.             ;
  81.  
  82.         menuItem -optionBox true
  83.             -label "Move Tool Option Box"
  84.             -annotation (getRunTimeCommandAnnotation("MoveToolOptions"))
  85.             -image "move_M.xpm" 
  86.             -command "MoveToolOptions"
  87.             ;
  88.  
  89.         menuItem 
  90.             -label "Rotate Tool" 
  91.             -annotation (getRunTimeCommandAnnotation("RotateTool"))
  92.             -image "rotate_M.xpm"
  93.             -command "RotateTool"
  94.             -dragDoubleClickCommand "RotateToolOptions"
  95.             ;
  96.  
  97.         menuItem -optionBox true
  98.             -label "Rotate Tool Option Box"
  99.             -annotation (getRunTimeCommandAnnotation("RotateToolOptions"))
  100.             -image "rotate_M.xpm" 
  101.             -command "RotateToolOptions"
  102.             ;
  103.  
  104.         menuItem 
  105.             -label "Scale Tool" 
  106.             -annotation (getRunTimeCommandAnnotation("ScaleTool"))
  107.             -image "scale_M.xpm"
  108.             -command "ScaleTool"
  109.             -dragDoubleClickCommand "ScaleToolOptions"
  110.             ;
  111.  
  112.         menuItem -optionBox true
  113.             -label "Scale Tool Option Box"
  114.             -annotation (getRunTimeCommandAnnotation("ScaleToolOptions"))
  115.             -image "scale_M.xpm" 
  116.             -command "ScaleToolOptions"
  117.             ;
  118.  
  119.         menuItem 
  120.             -label "Move Normal Tool" 
  121.             -annotation (getRunTimeCommandAnnotation("MoveNormalTool"))
  122.             -image "moveNormal.xpm"
  123.             -command "MoveNormalTool"
  124.             -dragDoubleClickCommand "MoveNormalToolOptions"
  125.             ;
  126.  
  127.         menuItem -optionBox true
  128.             -label "Move Normal Tool Option Box"
  129.             -annotation (getRunTimeCommandAnnotation("MoveNormalToolOptions"))
  130.             -image "moveNormal.xpm" 
  131.             -command "MoveNormalToolOptions"
  132.             ;
  133.  
  134.         menuItem -d true;
  135.  
  136.         menuItem -l "Move/Rotate/Scale Tool" 
  137.             -annotation "Move/Rotate/Scale Tool: Select any object(s) or component(s)"
  138.             -image "srt.xpm"
  139.             -c "MoveRotateScaleTool";
  140.         menuItem -l "Show Manipulator Tool" 
  141.             -annotation "Show Manipulator Tool: Select any node"
  142.             -image "showManip.xpm"
  143.             -c "ShowManipulatorTool";
  144.  
  145.         // Default Manipulators
  146.         //
  147.         menuItem -l "Default Object Manipulator" -sm true -to true defManipItem;
  148.             menuItem -l "None" 
  149.                 -annotation "Remove Default Manipulator: Select any object"
  150.                 -c "setDefaultManip 0" noneManipItem;
  151.             menuItem -d true;
  152.             menuItem -l "Move" 
  153.                 -annotation "Set Default Manipulator to Move: Select any object"
  154.                 -c "setDefaultManip 1" transManipItem;
  155.             menuItem -l "Rotate" 
  156.                 -annotation "Set Default Manipulator to Rotate: Select any object"
  157.                 -c "setDefaultManip 2" rotateManipItem;
  158.             menuItem -l "Scale" 
  159.                 -annotation "Set Default Manipulator to Scale: Select any object"
  160.                 -c "setDefaultManip 3" scaleManipItem;
  161.         setParent -m ..;
  162.         if( $dimWhenNoSelect )
  163.             dimWhen -f "SomethingSelected" ($parent+"|transHierItem|defManipItem");
  164.  
  165.         menuItem -d true;
  166.  
  167.         menuItem -l "Proportional Modification Tool"
  168.             -annotation "Proportional Modification Tool: Select objects or components to modify proportionally"
  169.             -image "propMod.xpm"
  170.             -c "ProportionalModificationTool" propModItem;
  171.                    menuItem -optionBox  true -image "propMod.xpm"
  172.                 -annotation "Proportional Modification Tool Option Box"
  173.                 -l "Proportional Modification Tool Option Box"
  174.                 -c "setToolTo $gPropMod; toolPropertyWindow" 
  175.                 propModDialogItem;
  176.  
  177.     setParent -m ..;
  178.  
  179.     // Limits
  180.     //
  181.     setParent -m ..;
  182.  
  183.     menuItem -l "Reset Transformations" 
  184.         -annotation "Reset Transformation: Select an object(s)"
  185.         -c "ResetTransformations" identityResetItem;
  186.     if( $dimWhenNoSelect )    
  187.         dimWhen -f "SomethingSelected" ($parent+"|identityResetItem");
  188.     menuItem -optionBox true
  189.         -annotation "Reset Transformations Option Box"
  190.         -l "Reset Transformations Option Box"
  191.         -c "ResetTransformationsOptions"
  192.         identityResetItemOption;
  193.  
  194.     menuItem -l "Freeze Transformations" 
  195.         -annotation "Freeze Transformation: Select an object(s)"
  196.         -c "FreezeTransformations" 
  197.         identityApplyItem;
  198.     if( $dimWhenNoSelect )
  199.         dimWhen -f "SomethingSelected" ($parent+"|identityApplyItem");
  200.     menuItem -optionBox true
  201.         -annotation "Freeze Transformations Option Box"
  202.         -l "Freeze Transformations Option Box"
  203.         -c "FreezeTransformationsOptions"
  204.         identityApplyItemOption;
  205.  
  206.     menuItem -l "Snap Align Objects" -subMenu true -aob true -to true 
  207.         graspItem;
  208.  
  209.         string $g1Item = `menuItem -l "Point to Point" 
  210.             -annotation "Snap Point to Point: Select any type of point object or component" 
  211.             -image "pointToPoint.xpm"
  212.             -c "SnapPointToPoint" snap1PointItem`;
  213.            if( $dimWhenNoSelect )
  214.             dimWhen -f "SomethingSelected" $g1Item;
  215.         menuItem -optionBox true
  216.             -annotation "Snap Point Option Box"
  217.             -image "pointToPoint.xpm"
  218.             -l "Snap Point to Point Option Box"
  219.             -c "SnapPointToPointOptions"
  220.             snapPointItemOption;
  221.  
  222.         string $g2Item = `menuItem -l "2 Points to 2 Points"
  223.             -annotation "Snap 2 Points to 2 Points: Select any type of point object or component" 
  224.             -image "twoPointToPoint.xpm"
  225.             -c "Snap2PointsTo2Points" snap2PointsItem`;
  226.            if( $dimWhenNoSelect )
  227.             dimWhen -f "SomethingSelected" $g2Item;
  228.         menuItem -optionBox true
  229.             -annotation "Snap 2 Points Option Box"
  230.             -image "twoPointToPoint.xpm"
  231.             -l "Snap 2 Points to 2 Points Option Box"
  232.             -c "Snap2PointsTo2PointsOptions"
  233.             snap2PointsItemOption;
  234.  
  235.         string $g3Item = `menuItem -l "3 Points to 3 Points"
  236.             -annotation "Snap 3 Points to 3 Points: Select any type of point object or component" 
  237.             -image "threePointToPoint.xpm"
  238.             -dmc "performSnap3PtTo3Pt 2"
  239.             -c "Snap3PointsTo3Points" snap3PointsItem`;
  240.            if( $dimWhenNoSelect )
  241.             dimWhen -f "SomethingSelected" $g3Item;
  242.         menuItem -optionBox true
  243.             -annotation "Snap 3 Points Option Box"
  244.             -image "threePointToPoint.xpm"
  245.             -l "Snap 3 Points to 3 Points Option Box"
  246.             -c "Snap3PointsTo3PointsOptions"
  247.             snap3PointsItemOption;
  248.  
  249.         menuItem -l "Align Objects"
  250.             -ann "Align Objects: Align the selected objects."
  251.             -c "performAlignObjects 0" -i "alignObjects.xpm" ;
  252.  
  253.         menuItem -optionBox 1 -l "Align Objects Option Box" 
  254.             -ann "Align Objects Option Box"
  255.             -c "performAlignObjects 1" -ecr false -i "alignObjects.xpm" ;
  256.  
  257.         menuItem -divider true;
  258.  
  259.         menuItem -label "Align Tool"
  260.             -annotation "Align Tool: Align the selection to the last selected object"
  261.             -image "alignTool.xpm"
  262.             -command "setToolTo alignToolCtx"
  263.             alignToolItem;
  264.  
  265.         menuItem -label "Snap Together Tool"
  266.             -annotation "Snap Together Tool: Snap two objects together"
  267.             -image "snapTogetherTool.xpm"
  268.             -command "setToolTo snapTogetherToolCtx"
  269.             snapTogetherToolItem;
  270.  
  271.             menuItem -optionBox true
  272.                 -label "Snap Together Tool Option Box"
  273.                 -annotation "Snap Together Tool Option Box"
  274.                 -command "setToolTo snapTogetherToolCtx; toolPropertyWindow"
  275.                 snapTogetherToolDialogItem;
  276.  
  277.     setParent -m ..;
  278.  
  279.     menuItem -divider true;
  280.  
  281.     menuItem -label "Evaluate Nodes" -subMenu true -tearOff true;
  282.         menuItem -label "Evaluate All" 
  283.             -annotation "Evaluate All: Enable evaluation of all nodes"
  284.             -c "EnableAll";
  285.         menuItem -label "Ignore All" 
  286.             -annotation "Ignore All: Ignore evaluation of all nodes"
  287.             -c "DisableAll";
  288.         menuItem -d true;
  289.         menuItem -l "IK Solvers" 
  290.             -annotation "Enable IK Solvers: Enable/Disable evaluation of all IK solvers"
  291.             -cb on
  292.             -c "EnableIKSolvers"
  293.             iksolverOnOff;
  294.         menuItem -l "Constraints" 
  295.             -annotation "Enable Constraints: Enable/Disable evaluation of all Constraints"
  296.             -cb on
  297.             -c "EnableConstraints"
  298.             constraintOnOff;
  299.         menuItem -l "Expressions" 
  300.             -annotation "Enable Expressions: Enable/Disable evaluation of all Expressions"
  301.             -cb on
  302.             -c "EnableExpressions"
  303.             expressionOnOff;
  304.         if( fluidEditLicenseFound() ) {
  305.             menuItem -l "Fluids" 
  306.                 -annotation (getRunTimeCommandAnnotation("EnableFluids"))
  307.                 -cb on
  308.                 -c "EnableFluids"
  309.                 fluidOnOff;
  310.         }
  311.         menuItem -l "Global Stitch" 
  312.             -annotation "Enable Global Stitch: Enable/Disable evaluation of all Global Stitch nodes"
  313.             -cb on
  314.             -c "EnableGlobalStitch"
  315.             globalstitchOnOff;
  316.         menuItem -l "Particles" 
  317.             -annotation "Enable Particles: Enable/Disable evaluation of all Particles"
  318.             -cb on
  319.             -c "EnableParticles"
  320.             particleOnOff;
  321.         menuItem -l "Rigid Bodies" 
  322.             -annotation "Enable Rigid Bodies: Enable/Disable evaluation of all Rigid Bodies"
  323.             -cb on
  324.             -c "EnableRigidBodies"
  325.             rigidbodyOnOff;
  326.         menuItem -l "Snapshots" 
  327.             -annotation "Enable Snapshots: Enable/Disable evaluation of all Snapshot nodes"
  328.             -cb on
  329.             -c "EnableSnapshots"
  330.             snapshotOnOff;
  331.  
  332.         // If no fx license, grey out the entries for those nodes.
  333.         //
  334.         if (!`licenseCheck -mode edit -type fx`)
  335.         {
  336.             menuItem -e -enable false particleOnOff;
  337.         }
  338.         if (!`licenseCheck -mode edit -type complete`)
  339.         {
  340.             menuItem -e -enable false rigidbodyOnOff;
  341.         }
  342.     setParent -m ..;
  343.  
  344.     menuItem -divider true;
  345.  
  346.     menuItem -l "Make Live" 
  347.         -image "makeLive.xpm"
  348.         -ec true
  349.         -c "MakeLive" liveItem;
  350.  
  351.     string $cpItem = `menuItem -l "Center Pivot" 
  352.         -annotation "Center Pivot: Select an object(s)" 
  353.         -c "CenterPivot" centrePivotItem`;
  354.        if( $dimWhenNoSelect )
  355.         dimWhen -f "SomethingSelected" $cpItem;
  356.  
  357.     string $prefItem = `menuItem -l "Prefix Hierarchy Names..."
  358.         -annotation "Prefix Hierarchy Names: Add a prefix to all hierarchy names" 
  359.         -c "PrefixHierarchyNames" prefixHierarchyItem`;
  360.        if( $dimWhenNoSelect )
  361.         dimWhen -f "SomethingSelected" $prefItem;
  362.  
  363.     menuItem -divider true;
  364.  
  365.     string $addItem = `menuItem -l "Add Attribute..." 
  366.         -annotation "Add Attribute: Add dynamic attributes to the selected object(s)" 
  367.         -c "AddAttribute" addAttrItem`;
  368.        if( $dimWhenNoSelect )
  369.         dimWhen -f "SomethingSelected" $addItem;
  370.  
  371.     string $renameItem = `menuItem -l "Edit Attribute..." 
  372.         -annotation "Edit Attribute: Change properties of dynamic attributes of the selected object(s)" 
  373.         -c "RenameAttribute" renameAttrItem`;
  374.        if( $dimWhenNoSelect )
  375.         dimWhen -f "SomethingSelected" $renameItem;
  376.  
  377.     string $deleteItem = `menuItem -l "Delete Attribute..." 
  378.         -annotation "Delete Attribute: Delete dynamic attributes from the selected object(s)"
  379.         -c "DeleteAttribute" deleteAttrItem`;
  380.        if( $dimWhenNoSelect )
  381.         dimWhen -f "SomethingSelected" $deleteItem;
  382.  
  383.     menuItem -divider true;
  384.  
  385.     // conversion operations
  386.     menuItem -l "Convert" -sm true -to true -aob true surfConvItem;
  387.  
  388.     
  389.     // NURBS to Polygons
  390.     if( `isTrue SurfaceUIExists` ) {
  391.         menuItem -l "NURBS to Polygons"
  392.             -c "NURBSToPolygons"
  393.             -dmc "performnurbsToPoly 2"
  394.             -annotation "NURBS to Polygons: Select NURBS surface(s)"
  395.             -image "nurbsToPolygons.xpm"
  396.             nurbsToPolyItem;
  397.         menuItem -optionBox true 
  398.             -annotation "NURBS to Polygons Option Box"
  399.             -l "NURBS to Polygons Option Box"
  400.             -image "nurbsToPolygons.xpm" 
  401.             -c "NURBSToPolygonsOptions"
  402.             nurbsToPolyDialogItem;
  403.     }
  404.  
  405.     // NURBS to Subdivs
  406.     if( `isTrue SubdivUIExists` ) {
  407.         menuItem -l "NURBS to Subdiv" -ecr true 
  408.             -command "CreateSubdivSurface"
  409.             -annotation "NURBS to Subdiv: Select NURBS surface(s)"
  410. //            -image ""  // An icon needs to be created
  411.             -dragMenuCommand "performSubdivCreate 2"
  412.             subdivCreateItem;
  413.         menuItem -optionBox 1 
  414.             -command "CreateSubdivSurfaceOptions"
  415.             -annotation "Subdiv Create Option Box" 
  416. //            -image ""  // An icon needs to be created
  417.             -l "Subdiv Create Option Box" -ecr false 
  418.             subdivCreateOptionItem;
  419.     }
  420.     
  421.     // Poly to Subdivs (same as NURBS to Subdiv)
  422.     if( `isTrue SubdivUIExists` ) {
  423.         menuItem -l "Polygons to Subdiv" -ecr true 
  424.             -command "CreateSubdivSurface"
  425.             -annotation "Polygons to Subdiv: Select polygon surface(s)"
  426.             -image subdivCreate.xpm
  427.             -dragMenuCommand "performSubdivCreate 2"
  428.             subdivCreateItem2;
  429.         menuItem -optionBox 1 
  430.             -command "CreateSubdivSurfaceOptions"
  431.             -annotation "Subdiv Create Option Box" 
  432.             -image subdivCreate.xpm
  433.             -l "Subdiv Create Option Box" -ecr false 
  434.             subdivCreateOptionItem2;
  435.     }
  436.         
  437.     // Subdivs to Poly
  438.     if( `isTrue SubdivUIExists` ) {
  439.         menuItem -l "Subdiv To Polygons" -ecr true 
  440.             -ann "Subdiv To Polygons: Select subdivision surface(s)"
  441.             -image subdivTessellate.xpm
  442.             -c "TesselateSubdivSurface"     
  443.             subdivTessellateItem;
  444.         menuItem -optionBox 1 
  445.             // need to add -i option
  446.             -annotation "Subdiv To Polygons Option Box" 
  447.             -image subdivTessellate.xpm
  448.             -l "Subdiv Tessellate Option Box" -ecr false 
  449.             -c "TesselateSubdivSurfaceOptions" 
  450.             subdivTessellateOptionItem;
  451.     }
  452.  
  453.     // Subdivs to NURBS
  454.     if( `isTrue SubdivUIExists` ) {
  455.         menuItem -l "Subdiv to NURBS" -ecr true 
  456.             -command "SubdivToNURBS"
  457.             -annotation "Create NURBS Surfaces"
  458.             -image subdivToNurbs.xpm
  459.             -dragMenuCommand "performSubdToNurbs 2"
  460.             subdivCreateItem3;
  461.         menuItem -optionBox 1 
  462.             // need to add -i option
  463.             -annotation "Subdiv To NURBS Option Box" 
  464.             -image subdivToNurbs.xpm
  465.             -l "Subdiv To NURBS Option Box" -ecr false 
  466.             -c "SubdivToNURBSOptions" 
  467.             subdivToNurbsOptionItem;
  468.     }
  469.  
  470.     // Paint Effects to Poly
  471.     if( `isTrue "MayaCreatorExists"` ) {
  472.         menuItem -l "Paint Effects To Polygons" -ecr true 
  473.             -ann "Paint Effects To Polygons: Select paint effects stroke(s)"
  474.             -image subdivTessellate.xpm // TODO: pfx tessellate icon
  475.             -c "PaintEffectsToPoly"     
  476.             paintEffectsToPolyItem;
  477.         menuItem -optionBox 1 
  478.             -annotation "Paint Effects To Polygons Option Box" 
  479.             -image subdivTessellate.xpm // TODO: see above
  480.             -l "Paint Effects To Poly Option Box" -ecr false 
  481.             -c "PaintEffectsToPolyOptions" 
  482.             paintEffectsToPolyOptionItem;
  483.     }
  484.     
  485.     // Displacement to Poly
  486.     menuItem -l "Displacement to Polygons"
  487.         -annotation "Displacement to Polygons: Select displacement mapped object(s)"
  488.         -c "DisplacementToPolygon"
  489.         dispPolyItem;
  490.  
  491.         if( fluidEditLicenseFound() )
  492.         {
  493.             menuItem -l "Fluid To Polygons"
  494.                 -annotation "Fluid To Polygons: Select fluid to convert"
  495.                 -image "fluidtoPoly.xpm" 
  496.                 -c "performFluids 1 FluidToPoly 0"
  497.                 fluidToPolygonsItem;
  498.         }
  499.             
  500.     setParent -m ..;
  501.  
  502.  
  503.     if (true || `licenseCheck -m "edit" -typ "artisan"` ) {
  504.         menuItem -d true;
  505.  
  506.          menuItem -l "Script Paint Tool"
  507.              -image "userPaint.xpm" 
  508.              -annotation "Script Paint Tool: Paint custom effects defined in a MEL script on a surface"
  509.              -c "ScriptPaintTool" userPaintItem;
  510.              menuItem -optionBox true -image "userPaint.xpm" 
  511.                  -annotation "Script Paint Tool Option Box"
  512.                  -l "Script Paint Tool Option Box"
  513.                  -c "ScriptPaintToolOptions" 
  514.                  userPaintDialogItem;
  515.         
  516.         // Attribute Paint Tool
  517.         menuItem -l "Attribute Paint Tool"
  518.             -image "artAttr.xpm"
  519.             -annotation "Attribute Paint Tool: Paint paintable attributes. "
  520.             -c "ArtPaintAttrTool" artisanPaintAttrItem;
  521.             menuItem -optionBox true -image "artAttr.xpm"
  522.                 -annotation "Artisan Attribute Paint Tool Option Box"
  523.                 -l "Artisan Attribute Paint Tool Option Box"
  524.                 -c "ArtPaintAttrToolOptions"
  525.                 artisanPaintAttrDialogItem;
  526.  
  527.     }
  528.     
  529.     updateModObjectsMenu ($parent);
  530. }
  531.